﻿package com.vinyl.controls
{
	import flash.errors.IllegalOperationError;
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;
	import flash.utils.getQualifiedSuperclassName;

	import flash.display.MovieClip;

	public class ButtonView extends MovieClip
	{
		public static var NORMAL_UP: String = 'normal_up';
		public static var NORMAL_OVER: String = 'normal_over';
		public static var NORMAL_DOWN: String = 'normal_down';
		public static var ACTIVE_UP: String = 'active_up';
		public static var ACTIVE_OVER: String = 'active_over';
		public static var ACTIVE_DOWN: String = 'active_down';
		
		public function ButtonView()
		{
			checkAbstract();
		}
		
		private function checkAbstract():void 
		{
			var className : String = getQualifiedClassName(this);
			if (getDefinitionByName(className) == ButtonView ) 
			{
				throw new ArgumentError(
				getQualifiedClassName(this) + "클래스를 인스턴스화할 수 없습니다.");
			}
		}
		
		public function setState( state: String ) : void 
		{
			var message : String = 
				"추상 메서드 setState(" + getQualifiedSuperclassName(this) + ")이(가) " 
				+ getQualifiedClassName(this) + "클래스에서 구현되지 않았습니다.";
			throw new IllegalOperationError(message); 
		}
	}
}